//
//  HeaderView.m
//  sweet
//
//  Created by 甘世清 on 2022/12/3.
//

#import "HeaderView.h"

@implementation HeaderView
 
- (void)SQ_UIViewForSelfView{
    self.layer.masksToBounds = YES;
   _headerImage = [[UIImageView alloc]init];
//    _headerImage.contentMode = UIViewContentModeScaleAspectFit;
    [self addSubview:_headerImage];
    [_headerImage mas_makeConstraints:^(MASConstraintMaker *make) {
           make.edges.equalTo(self);
    }];
    _btn = [UIButton buttonWithType:UIButtonTypeCustom];
    _btn.backgroundColor = UIColor.clearColor;
    [self addSubview:_btn];
    [_btn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self);
    }];
}
- (void)setFont:(UIFont *)font{
    _font = font;
    _btn.titleLabel.font = font;
}
- (void)setText:(NSString *)text{
    _text = text;
    [_btn setTitle:text forState:normal];
}
- (void)setColorString:(NSString *)colorString{
    _colorString = colorString;
    [_btn setTitleColor:SQColor(colorString) forState:normal];
}
- (void)setImage:(NSString *)image{
    _image = image;
    self.headerImage.image = SQGetImage(image);
}

@end
